package msi.gama.display.java3d.coordinate;

import javax.media.j3d.TransformGroup;
import javax.vecmath.Color3f;
import javax.vecmath.Point3f;

/**
 * minhvv, p18, IFI, TPE 01/2014 - 07/2014
 */

public class CoordinateObject {
	private TransformGroup root;

	public CoordinateObject() {
		root = new TransformGroup();
		drawCoordianateLines();
	}

	private void drawCoordianateLines() {
		Point3f pO = new Point3f(0, 0, 0);
		Point3f pX = new Point3f(1, 0, 0);
		Point3f pY = new Point3f(0, 1, 0);
		Point3f pZ = new Point3f(0, 0, 1);

		LineObject ox = new LineObject(pO, pX, new Color3f(1.0f, 0.0f, 0.0f));
		LineObject oy = new LineObject(pO, pY, new Color3f(0.0f, 1.0f, 0.0f));
		LineObject oz = new LineObject(pO, pZ, new Color3f(0.0f, 0.0f, 1.0f));

		root.addChild(ox.getShape());
		root.addChild(oy.getShape());
		root.addChild(oz.getShape());
	}

	public TransformGroup getScene() {
		return root;
	}
}
